#pragma once
#include "cocos2d.h"
#include "Game/FV/FvSingleton.h"
#include "Kernel/kernel/server/IServerPrivateSink.h"

class HNPrivateScenceBase
	:public cocos2d::Node
	,public IServerPrivateSink
{
public:
	enum Type_LinkAction
	{
		Type_Link_NULL,
		Type_Link_Create,
		Type_Link_Join,
	};
public:
	HNPrivateScenceBase();
	~HNPrivateScenceBase();
public:
	void		upJoinNumTxt();
public:
	virtual void OnSocketSubPrivateInfo(CMD_GR_Private_Info* pNetInfo);
	virtual void OnSocketSubPrivateCreateSuceess(CMD_GR_Create_Private_Sucess* pNetInfo);
	virtual void OnSocketSubPrivateRoomInfo(CMD_GF_Private_Room_Info* pNetInfo);
	virtual void OnSocketSubPrivateEnd(CMD_GF_Private_End_Info* pNetInfo);
	virtual void OnSocketSubPrivateDismissInfo(CMD_GF_Private_Dismiss_Info* pNetInfo);
	virtual void OnSocketSubPrivateDiamondInfo(CMD_GR_REFRESH_DIAMOND* pNetInfo);
public:
	void		Button_JoinNum(char ch);
	void		Button_JoinNumDel();
	void		Button_JoinNumReset();
	
	void		Button_SureeDismissPrivate();
	void		Button_DismissPrivate();
	void		Button_DismissPrivateNot();
	
	void		ConnectAndCreatePrivateByKindID(int iKindID,const CMD_GR_Create_Private& kNet);
	void		ConnectAndCreatePrivateByServerID(int iServerID,const CMD_GR_Create_Private& kNet);
protected:
	int			m_iJoinCout;
	char		m_kJoinNumTxt[7];

	int			m_kActJoinNum;
	Node*		joinRoomPlane;
	int			m_channelIndex;
	float		m_exchangeScore;
	CMD_GR_Private_Info	m_kPrivateInfo;
	CMD_GF_Private_Room_Info m_kPrivateRoomInfo;

	CMD_GR_Create_Private	m_kCreatePrivateNet;
	Type_LinkAction			m_eLinkAction;
};